/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.dealer.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.dealer.entity.ViDealerZone;
import com.vivo.dealer.dao.ViDealerZoneDao;

/**
 * 核算中心绑定Service
 * @author jyangye
 * @version 2018-02-07
 */
@Service
@Transactional(readOnly = true)
public class ViDealerZoneService extends CrudService<ViDealerZoneDao, ViDealerZone> {

    @Autowired
    private ViDealerZoneDao viDealerZoneDao;

	public ViDealerZone get(String id) {
		return super.get(id);
	}
	
	public List<ViDealerZone> findList(ViDealerZone viDealerZone) {
	    viDealerZone.getSqlMap().put("dsf", dataScopeFilterByCompany(viDealerZone.getCurrentUser(), "a"));
		return super.findList(viDealerZone);
	}
	
	public Page<ViDealerZone> findPage(Page<ViDealerZone> page, ViDealerZone viDealerZone) {
        viDealerZone.getSqlMap().put("dsf", dataScopeFilterByCompany(viDealerZone.getCurrentUser(), "a"));
		return super.findPage(page, viDealerZone);
	}

	public List<ViDealerZone> getAgentByComp(ViDealerZone viDealerZone) {
	    return viDealerZoneDao.getAgentByComp(viDealerZone);
    }
	
	@Transactional(readOnly = false)
	public void save(ViDealerZone viDealerZone) {
		super.save(viDealerZone);
	}
	
	@Transactional(readOnly = false)
	public void delete(ViDealerZone viDealerZone) {
		super.delete(viDealerZone);
	}
	
}